<!doctype html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
  <title>清华大学学生教育互联网公益协会</title>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}" />
  <script th:src = "@{/js/jquery.min.js}"></script>
  <script th:src = "@{/js/bootstrap.min.js}"></script>

  <style>
    .navbar-brand {
      padding: 0 15px;
    }
  </style>
</head>
<body>
  <div class="container">
    <header>
      <nav class="navbar navbar-default bg-faded">
        <div class="container-fluid">
          <!-- Brand and toggle get grouped for better mobile display -->
          <div class="navbar-header">
            <a class="navbar-brand" href="#"><img th:src="@{/img/brand.jpg}" height="50"/></a>
          </div>
        </div><!-- /.container-fluid -->
      </nav>
    </header>
    <main>
      <form class="form-horizontal" method="post">
      	<div class="form-group">
          <label for="type" class="col-sm-2 control-label">用户类型</label>
          <div class="col-sm-10">
            <label class="radio-inline">
			  <input type="radio" name="type" id="type1" value="USER" required="required"
			  	th:checked="${user!=null and user.type.toString()=='USER'}" /> 学生
			</label>
			<label class="radio-inline">
			  <input type="radio" name="type" id="type2" value="VOLUNTEER" required="required"
			  	th:checked="${user!=null and user.type.toString()=='VOLUNTEER'}" /> 哥哥姐姐
			</label>
          </div>
        </div>
        <div class="form-group">
          <label for="username" class="col-sm-2 control-label">用户名</label>
          <div class="col-sm-10">
            <input name="username" type="text" class="form-control" id="username" th:value="${user!=null?user.username:''}" />
          </div>
        </div>
        <div class="form-group">
          <label for="password" class="col-sm-2 control-label">密码</label>
          <div class="col-sm-10">
            <input name="password" type="password" class="form-control" id="password" th:value="${user!=null?user.password:''}" />
          </div>
        </div>
        <div class="form-group">
          <label for="nickname" class="col-sm-2 control-label">昵称</label>
          <div class="col-sm-10">
            <input name="nickname" type="text" class="form-control" id="nickname" th:value="${user!=null?user.nickname:''}" />
          </div>
        </div>
        <div class="form-group">
          <label for="email" class="col-sm-2 control-label">邮箱</label>
          <div class="col-sm-10">
            <input name="email" type="email" class="form-control" id="email" 
            	th:value="${user!=null?user.email:''}" required="required" />
          </div>
        </div>
        <div class="form-group">
          <label for="sex" class="col-sm-2 control-label">性别</label>
          <div class="col-sm-10">
            <select id="sex" name="sex" class="form-control" th:value="${user!=null?user.sex:'MAIL'}">
              <option value="MAIL">男</option>
              <option value="FEMAIL">女</option>
            </select>
          </div>
        </div>
        <div class="form-group">
          <label for="profile" class="col-sm-2 control-label">个人简介</label>
          <div class="col-sm-10">
            <textarea id="profile" name="profile" class="form-control" rows="3" th:inline="text" >[[${user!=null?user.profile:''}]]</textarea>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary">保存</button>
            <p class="text-danger" th:if="${error != null}" th:text="${error}"></p>
          </div>
        </div>
      </form>
    </main>
  </div>
</body>
</html>
